<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="java.util.Date" %><%--
  Created by IntelliJ IDEA.
  User: 任宝顺
  Date: 2022/3/5
  Time: 18:47
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>展示类别信息</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/css/style.css" />
</head>
<body>
<div id="wrap">
    <div id="top_content">
        <div id="header">
            <div id="rightheader">
                <p>
                    <% Date date = new Date();
                        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                        String now = sdf.format(date);
                    %>
                    <%=now%>
                </p>
            </div>
            <div id="topheader">
                <h1 id="title">
                    <a href="#">main</a>
                </h1>
            </div>
            <div id="navigation">
            </div>
        </div>
        <div id="content">
            <p id="whereami">
            </p>
            <h1>
                Welcome!
            </h1>
            <table class="table">
                <tr class="table_header">
                    <td>
                        类别编号
                    </td>
                    <td>
                        列表名称
                    </td>
                    <td>
                        该类别下饮品数量
                    </td>
                    <td>
                        操作
                    </td>
                </tr>
                <c:forEach items="${categories}" var="category">
                <tr>
                    <td>
                        ${category.categoryId}
                    </td>
                    <td>
                        <a href="${pageContext.request.contextPath}/grang/selectAllTeaAndCategoryByCategoryName.do?categoryName=${category.categoryName}">${category.categoryName}</a>
                    </td>
                    <td>
                        ${category.teaNum}
                    </td>
                    <td>
                        <a href="${pageContext.request.contextPath}/grang/deleteCategory.do?categoryId=${category.categoryId}">删除类别</a>&nbsp;
                    </td>
                </tr>
<%--                <tr>--%>
<%--                    <td>--%>
<%--                        2--%>
<%--                    </td>--%>
<%--                    <td>--%>
<%--                        <a href="tealist.jsp">类别2</a>--%>
<%--                    </td>--%>
<%--                    <td>--%>
<%--                        20--%>
<%--                    </td>--%>
<%--                    <td>--%>
<%--                        <a href="#">删除类别</a>&nbsp;--%>
<%--                    </td>--%>
<%--                </tr>--%>
                </c:forEach>
            </table>
        </div>
    </div>
    <div id="footer">
        <div id="footer_bg">
            ABC@126.com
        </div>
    </div>
</div>
</body>
</html>
